package webpage;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Scanner;

public class CheckFriends {
	
	public ArrayList<String> checkFriends(ArrayList<String> result, String loginEmail) throws FileNotFoundException{
		
		String path = "C:/SVN/WebContent/Members/"+loginEmail+"/friends.txt";
		ArrayList<String> friends = new ArrayList<String>();
		for (int i=0;i<result.size();i++){
			String check = "Add as a friend";
			Scanner s = new Scanner(new File(path));
		while (s.hasNext()){
		    if (result.get(i).equals(s.next())){
		    	System.out.println("Remove from friends");
		    	check ="Remove from friends";
		    }
		    else {System.out.println("add");
		    
		}
		
	}
		friends.add(i,check);
		s.close();
	}
		System.out.println(friends);
		return friends;

}
}